/**
 * Collaborative Story Development Web Application (CSDApp) 
 * Copyright Anton Strack 2014
 *
 * This file is part of Collaborative Story Development Application (CSDApp).
 *
 * CSDApp is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or any later version.
 *
 * CSDApp is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * CSDApp. If not, see <http://www.gnu.org/licenses/>.
 *
 */
package csdwa;

import java.sql.Timestamp;

/**
 * This class represents an operation that is assigned to a user to be
 * preformed.
 *
 * @author Anton Strack
 */
public class Task extends Resource implements CsdwaRecordable, CsdwaNotifiable {

    /**
     * The id of the post that the task is referencing needs an action preformed
     * on.
     */
    private int postId;
    /**
     * The name of the task as will be visible to the end user.
     */
    private String name;
    /**
     * The detailed instructions of how to complete the task.
     */
    private String description;
    /**
     * The primary type of action the task recipient needs to do.
     */
    private int actionTypeId;
    /**
     * The resource type of the task post that the action will be preformed on.
     */
    private int postResourceTypeId;
    /**
     * The user id of who updated the task.
     */
    private int updatedById;
    /**
     * The timestamp when the task was updated.
     */
    private Timestamp updatedDate;
    /**
     * The state of the task towards its completion. This variable helps to
     * determine the visual marker that is added to the task display to inform
     * end users if they've started the task, completed the task, or haven't
     * read the task yet.
     */
    private int stateId;
    /**
     * The user id of the task recipient and thus who is expected to complete
     * the task.
     */
    private int recipientId;
    /**
     * the timestamp when the task's stateId changes and thus some progress has
     * been made towards completing the task.
     */
    private Timestamp statusDate;
    /**
     * The user id of who created the task and thus who owns the task.
     */
    private int createdById;
    /**
     * The timestamp when the task was created.
     */
    private Timestamp createdDate;

    public Task() {
    }

    public Task(int resourceTypeId) {
        super(resourceTypeId);
    }

    @Override
    public String toString() {
        return "Task{" + "postId=" + getPostId() + ", name=" + getName() + ", description=" + getDescription() + ", actionTypeId=" + getActionTypeId() + ", postResourceTypeId=" + getPostResourceTypeId() + ", updatedById=" + getUpdatedById() + ", updatedDate=" + getUpdatedDate() + ", stateId=" + getStateId() + ", recipientId=" + getRecipientId() + ", statusDate=" + getStatusDate() + '}';
    }

    /**
     * The id of the post that the task is referencing needs an action preformed
     * on.
     *
     * @return the postId
     */
    public int getPostId() {
        return postId;
    }

    /**
     * The id of the post that the task is referencing needs an action preformed
     * on.
     *
     * @param postId the postId to set
     */
    public void setPostId(int postId) {
        this.postId = postId;
    }

    /**
     * The name of the task as will be visible to the end user.
     *
     * @return the name
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * The name of the task as will be visible to the end user.
     *
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * The detailed instructions of how to complete the task.
     *
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * The detailed instructions of how to complete the task.
     *
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * The primary type of action the task recipient needs to do.
     *
     * @return the actionTypeId
     */
    public int getActionTypeId() {
        return actionTypeId;
    }

    /**
     * The primary type of action the task recipient needs to do.
     *
     * @param actionTypeId the actionTypeId to set
     */
    public void setActionTypeId(int actionTypeId) {
        this.actionTypeId = actionTypeId;
    }

    /**
     * The resource type of the task post that the action will be preformed on.
     *
     * @return the postResourceTypeId
     */
    public int getPostResourceTypeId() {
        return postResourceTypeId;
    }

    /**
     * The resource type of the task post that the action will be preformed on.
     *
     * @param postResourceTypeId the postResourceTypeId to set
     */
    public void setPostResourceTypeId(int postResourceTypeId) {
        this.postResourceTypeId = postResourceTypeId;
    }

    /**
     * The user id of who updated the task.
     *
     * @return the updatedById
     */
    public int getUpdatedById() {
        return updatedById;
    }

    /**
     * The user id of who updated the task.
     *
     * @param updatedById the updatedById to set
     */
    public void setUpdatedById(int updatedById) {
        this.updatedById = updatedById;
    }

    /**
     * The timestamp when the task was updated.
     *
     * @return the updatedDate
     */
    @Override
    public Timestamp getUpdatedDate() {
        return updatedDate;
    }

    /**
     * The timestamp when the task was updated.
     *
     * @param updatedDate the updatedDate to set
     */
    public void setUpdatedDate(Timestamp updatedDate) {
        this.updatedDate = updatedDate;
    }

    /**
     * The state of the task towards its completion. This variable helps to
     * determine the visual marker that is added to the task display to inform
     * end users if they've started the task, completed the task, or haven't
     * read the task yet.
     *
     * @return the stateId
     */
    @Override
    public int getStateId() {
        return stateId;
    }

    /**
     * The state of the task towards its completion. This variable helps to
     * determine the visual marker that is added to the task display to inform
     * end users if they've started the task, completed the task, or haven't
     * read the task yet.
     *
     * @param stateId the stateId to set
     */
    public void setStateId(int stateId) {
        this.stateId = stateId;
    }

    /**
     * The user id of the task recipient and thus who is expected to complete
     * the task.
     *
     * @return the recipientId
     */
    public int getRecipientId() {
        return recipientId;
    }

    /**
     * The user id of the task recipient and thus who is expected to complete
     * the task.
     *
     * @param recipientId the recipientId to set
     */
    public void setRecipientId(int recipientId) {
        this.recipientId = recipientId;
    }

    /**
     * the timestamp when the task's stateId changes and thus some progress has
     * been made towards completing the task.
     *
     * @return the statusDate
     */
    public Timestamp getStatusDate() {
        return statusDate;
    }

    /**
     * the timestamp when the task's stateId changes and thus some progress has
     * been made towards completing the task.
     *
     * @param statusDate the statusDate to set
     */
    public void setStatusDate(Timestamp statusDate) {
        this.statusDate = statusDate;
    }

    /**
     * The user id of who created the task and thus who owns the task.
     *
     * @return the createdById
     */
    public int getCreatedById() {
        return createdById;
    }

    /**
     * The user id of who created the task and thus who owns the task.
     *
     * @param createdById the createdById to set
     */
    public void setCreatedById(int createdById) {
        this.createdById = createdById;
    }

    /**
     * The timestamp when the task was created.
     *
     * @return the createdDate
     */
    @Override
    public Timestamp getCreatedDate() {
        return createdDate;
    }

    /**
     * The timestamp when the task was created.
     *
     * @param createdDate the createdDate to set
     */
    public void setCreatedDate(Timestamp createdDate) {
        this.createdDate = createdDate;
    }
}
